<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
    <style>
        .pink{
            color: pink;
        }
        .obj1{
            color: aqua;
        }
        .obj2{
            font-size: 20px;
        }
        .obj3{
            width: 100px;
            height: 100px;
            border: 2px solid black;
        }
    </style>
</head>
<body>
<div id="app">
<!--    1.v-bind批量绑定:绑定一个对象，对象中属性名为class的名字，属性值为布尔值，为true时意味着显示该类名-->
<!--    注意：批量绑定时不能使用语法糖的形式-->
    <div v-bind:class="className"></div>
<!--    2.v-bind绑定的值是一个字符串时-->
    <div :class="color">test bind</div>
<!--    3.v-bind绑定的值是一个对象时-->
    <div :class="objColor">test bind-obj</div>
<!--    4.v-bind绑定的值是一个数组-->
    <div :class="['obj1','obj2','obj3']">test bind-arr</div>
</div>
<script>
    const vm = new Vue({
        el:"#app",
        data(){
            return{
                className:{
                    one:true,
                    two:true,
                    three:true
                },
                color:'pink',
                objColor:{
                    obj1:true,
                    obj2:true,
                    obj3:true
                }
            }
        }
    })
</script>
</body>
</html>